Repository navigation
fix(cli): retry a slow Chrome start with backoff in render_page (#207) - #231
Merged
Merged
Conversation
The render-chrome test failed on busy CI runners with "Chrome did not start": two 20 s launches were not enough while turbo ran other suites. - chromeRenderer: up to three launches (`launches`), each with a fresh profile, a doubling pause (`backoffMs`, 1 s), and a configurable start budget (`startMs`, 20 s). The error names the last failure and the count. A launch that exits on its own is dropped and its profile removed; a failed launch only clears the shared Chrome when it is still the current one. `stop()` ends the renderer's Chrome. - The Chrome tests share one renderer, started in beforeAll with a 45 s start budget, so a cold start no longer eats a render's 50 s timeout. A Chrome that cannot start still fails every test with the launch error; renderer assertions are unchanged. - Fake-Chrome unit tests: three launches with new profiles, a hung launch killed after startMs, and recovery when a later launch starts. Closes #207 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Madraka <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
render_page's Chrome start no longer fails a busy CI runner after two 20 s attempts. The render tests no longer spend part of their 50 s render budget on a cold Chrome start. A real renderer regression still fails: every render assertion is unchanged, and there is no skip.Changes
packages/cli/src/render-chrome.tschromeRenderer(executable, options)takes three new options:launches(default 3): how many times to try;backoffMs(default 1 s): the pause before the second launch, doubled before each later one;startMs(default 20 s): how long one launch may take to print its DevTools endpoint.stop()ends the renderer's Chrome.launchChromeandkillChrome, which keepschromeRenderershort.packages/cli/test/render-chrome.test.tsbeforeAllwith a 45 s start budget and a 200 s hook timeout, andafterAllstops it. The sessions use separate browser contexts (cdp.ts), so sharing a Chrome is safe;cloudhal studiodoes the same in production.startMs, every launched process is gone afterwards, and the error says how long it waited;Changeset:
@cloudhal/clipatch.Tests (run locally, one at a time)
pnpm exec vitest run test/render-chrome.test.tsinpackages/cli: 7/7 passed in 24 s, with real Chrome.pnpm run typecheck(cli): clean.pnpm size:check: ok.The first local run found a tight timing in the new hung-launch test. With a 300 ms budget, the fake's shell sometimes hadn't logged its pid yet. The budget is now 1 s, about 10× a normal shell start. The kill itself was verified outside vitest, and both fake processes were gone.
Closes #207
🤖 Generated with Claude Code